<?php

function smarty_function_getip($params, &$smarty) {

  $smarty->assign("ip", $_SERVER['REMOTE_ADDR']);
}